<table class="inventory_table">
  <tr>
    <th class="info_cell">Наименование</th>
    <th class="info_cell">Срок годности<br />(в днях)</th>
    <th class="info_cell">Осталось в наличии</th>
    <th class="info_cell">Страна-производитель</th>
    <th class="info_cell">Стоимость аренды<br />(у.е./день)</th>
    <th colspan="2">&nbsp;</th>
  </tr>
</table>

{foreach from=$ITEMS item=inventoryItem}
  <div class="interactive_row">
    <table class="inventory_table info_row">
      <tr>
        <td class="info_cell">
          <a href="/inventory-info.html?id={$inventoryItem->GetId()}" title="Подробная информация">
            {$inventoryItem->GetName()}
          </a>
        </td>
        <td class="info_cell">{$inventoryItem->GetLifeTimeInDays()}</td>
        <td class="info_cell">{$inventoryItem->GetLeftInStock()}</td>
        <td class="info_cell">{$inventoryItem->GetCountryOfProduction()}</td>
        <td class="info_cell">{$inventoryItem->GetCostPerDay()}</td>
        <td class="edit_cell"><input class="edit_button"   type="button" value="Изменить"   /></td>
        <td class="edit_cell"><input class="delete_button" type="button" value="Удалить" /></td>
      </tr>
    </table>

    <form method="post" class="form_row hidden" action="/inventory.html">
      <table class="inventory_table">
        <tr>
          <td class="info_cell"><input class="input_field" name="name" value="{$inventoryItem->GetName()}" type="text" /></td>
          <td class="info_cell"><input class="input_field" name="lifetime_in_days" value="{$inventoryItem->GetLifeTimeInDays()}" type="text" /></td>
          <td class="info_cell"><input class="input_field" name="left_in_stock" value="{$inventoryItem->GetLeftInStock()}" type="text" /></td>
          <td class="info_cell"><input class="input_field" name="country_of_production" value="{$inventoryItem->GetCountryOfProduction()}" type="text" /></td>
          <td class="info_cell"><input class="input_field" name="cost_per_day" value="{$inventoryItem->GetCostPerDay()}" type="text" /></td>
          <td class="edit_cell">
            <input type="hidden" name="id" value="{$inventoryItem->GetId()}" />
            <input type="hidden" name="action" value="update" />
            <input class="update_button" type="submit" value="Изменить" />
          </td>
          <td class="edit_cell"><input class="cancel_button" type="button" value="Отмена" /></td>
        </tr>
      </table>
    </form>
  </div>
{foreachelse}
  <table class="inventory_table">
    <tr>
      <td colspan="7">
        Нет записей.
      </td>
    </tr>
  </table>
{/foreach}

<form method="post" class="form_row" action="/inventory.html">
  <table class="inventory_table last">
    <tr>
      <td class="info_cell"><input class="input_field" name="name" value="" type="text" /></td>
      <td class="info_cell"><input class="input_field" name="lifetime_in_days" value="" type="text" /></td>
      <td class="info_cell"><input class="input_field" name="left_in_stock" value="" type="text" /></td>
      <td class="info_cell"><input class="input_field" name="country_of_production" value="" type="text" /></td>
      <td class="info_cell"><input class="input_field" name="cost_per_day" value="" type="text" /></td>
      <td colspan="2">
        <input type="hidden" name="action" value="create" />
        <input class="add_button" type="submit" value="Добавить" />
      </td>
    </tr>
  </table>
</form>
